<template>
	<view class="user_page">
		<NavigationTitle :title="type=='add'?'添加项目':'项目详情'"
			style="color: #000;background: #fff;position: fixed;width: 100%;z-index: 5;">
			<template slot="left_con">
				<view @tap="backSelf" style="display: flex;align-items: center;">
					<image class="back_icon" src="@/static/common/back.png" mode="widthFix" />
					<text>列表</text>
				</view>
			</template>
		</NavigationTitle>
		<view class="status-bar"></view>
		<view class="form">
			<!-- <uni-steps :options="stepsObj" :active="stepsKey" class="uni-steps"></uni-steps> -->
			<uni-segmented-control class="uni-steps" :current="stepsKey" :values="['项目信息', '公司列表', '资料文件']"
				@clickItem="onClickItem" />
			<uni-forms ref="baseForm" :rules="rules" :modelValue="baseFormData"  class="form_main" 
				:label-position="alignment">
				<view v-show="stepsKey==0" class="form-tab form-tab_long">
					<uni-forms-item label="项目编号" required name="projNumber" >
						<uni-easyinput v-model="baseFormData.projNumber" placeholder="请输入项目编号"  :disabled="type=='edit'&&!authorList.includes('system_project_edit')"/>
					</uni-forms-item>
					<uni-forms-item label="项目名称" required name="projName">
						<uni-easyinput v-model="baseFormData.projName" placeholder="请输入项目名称"  :disabled="type=='edit'&&!authorList.includes('system_project_edit')"/>
					</uni-forms-item>
					<uni-forms-item label="项目开始时间" required name="projBeginTime">
						<uni-datetime-picker v-model="baseFormData.projBeginTime" type="date" @maskClick="maskClick"
							placeholder="请输入项目开始时间"  :disabled="type=='edit'&&!authorList.includes('system_project_edit')"/>
					</uni-forms-item>
					<uni-forms-item label="项目结束时间" required name="projEndTime">
						<uni-datetime-picker v-model="baseFormData.projEndTime" type="date" @maskClick="maskClick"
							placeholder="请输入项目结束时间"  :disabled="type=='edit'&&!authorList.includes('system_project_edit')"/>
					</uni-forms-item>
					<uni-forms-item label="所属区域" name="projRegion">
						<uni-data-picker placeholder="请输入所属区域" popup-title="请选择所在地区" :localdata="cityTree"
							v-model="baseFormData.projRegion" :map="{text:'name',value:'value'}" :readonly="type=='edit'&&!authorList.includes('system_project_edit')"/>
					</uni-forms-item>
					<uni-forms-item label="项目分类" name="projClassification">
						<uni-easyinput v-model="baseFormData.projClassification" placeholder="请输入项目分类"  :disabled="type=='edit'&&!authorList.includes('system_project_edit')"/>
					</uni-forms-item>
					<uni-forms-item label="项目框架金额" name="projFrameMoney">
						<uni-easyinput type='number' v-model="baseFormData.projFrameMoney" placeholder="请输入项目框架金额"  :disabled="type=='edit'&&!authorList.includes('system_project_edit')"/>
					</uni-forms-item>
					<uni-forms-item label="项目目标金额" name="projTargetMoney">
						<uni-easyinput type='number' v-model="baseFormData.projTargetMoney" placeholder="请输入项目目标金额"  :disabled="type=='edit'&&!authorList.includes('system_project_edit')"/>
					</uni-forms-item>
					<uni-forms-item label="结算方式" name="settlementMethod">
						<uni-easyinput v-model="baseFormData.settlementMethod" placeholder="请输入结算方式"  :disabled="type=='edit'&&!authorList.includes('system_project_edit')"/>
					</uni-forms-item>
					<uni-forms-item label="项目概述" name="remark">
						<uni-easyinput type="textarea" v-model="baseFormData.remark" placeholder="请输入项目概述"  :disabled="type=='edit'&&!authorList.includes('system_project_edit')"/>
					</uni-forms-item>
				</view>
				<view v-show="stepsKey==1" class="form-tab">
					<button type="primary" class="addBtn" @click="addFormItem">新增成员</button>
					<uni-forms-item v-for="(item,index) in dynamicLists" :key="item.compId?(item.compId+index):item.id"
						:label="'公司' + (index+1)+':'">
						<view class="form-item">
							<!-- <uni-data-select v-model="item.roleId" :localdata="roleOption" @change="changeRole"
								placeholder="请选择项目角色"></uni-data-select> -->
							<uni-data-picker placeholder="请选择用户角色" popup-title="请选择用户角色" :localdata="roleOption"
								:map="map" v-model="item.roleId" @change="changeRole" :readonly="type=='edit'&&!authorList.includes('system_project_edit')">
							</uni-data-picker>
							<uni-easyinput v-model="item.companyName" placeholder="请输入单位名称" :disabled="type=='edit'&&!authorList.includes('system_project_edit')"/>
							<uni-easyinput v-model="item.userName" placeholder="请输入负责人名字" :disabled="type=='edit'&&!authorList.includes('system_project_edit')"/>
							<uni-easyinput v-model="item.userPhone" placeholder="请输入负责人手机号" :disabled="type=='edit'&&!authorList.includes('system_project_edit')"/>
							<button class="form-item-button" size="mini" type="default"
								@click="delFormItem(item.id)">删除</button>
						</view>
					</uni-forms-item>
				</view>
				<view v-show="stepsKey==2" class=" form-tab form-tab_long">
					<view class="tab_select">
						<text class="seleName">选择公司：</text>
						<uni-data-select v-model="seleValue" :localdata="seleData" placeholder="请选择公司" :clear="false"
							@change="changeComp">
						</uni-data-select>
					</view>
					<button type="primary" class="open_list" @click="openList()" v-if="authorList.includes('system_file_add')">
						<uni-icons type="upload" size="36" color='#fff'></uni-icons>
					</button>
					<uni-drawer ref="showList" mode="left" :width="320" @change="changeDrawer">
						<view class="status-bar"></view>
						<lsj-upload ref="lsjUpload" childId="upload1" width="100%" height="100rpx" :option="option"
							:size=50 :instantly="false" :multiple="true" :formats='formats' @uploadEnd="onuploadEnd"
							@progress="onprogre" @change="changeFile">
							<button type="primary">选择文件</button>
						</lsj-upload>
						<view class="upload_title">
							<text>未上传的文件</text>
							<!-- <button size="mini" style="color: #000;" @click="subFile()">上传</button> -->

						</view>
						<view class="notUpload">
							<view v-for="(item,index) in files" :key="index" class="file_item">
								<view class="file_item_top">
									<text class="file_name">{{item.name}}</text>
									<image v-if="item.type=='waiting'" src="../../static/common/delete.png"
										class="file_del" @click.stop="()=>delFile(item,'noUpload')">
									</image>
								</view>
								<view>大小：<text>{{getSize(item.size)}}</text></view>
								<view>进度：<text>{{item.progress||0}}%</text></view>
								<view>状态：<text>{{item.type}}</text></view>
							</view>
						</view>
						<view class="no_upload_btn">
							<button size="mini" style="color: red;" @click="delAll()">清空</button>
							<button size="mini" class="btn" @click="subFile" type="primary">上传</button>
						</view>
					</uni-drawer>

					<view class="upload_title">
						<text style="flex: 1;">文件列表</text>
						<button size="mini" style="color: deepskyblue;width: 20%;" @click="()=>{
							if(authorList.includes('system_file')) getFileList({current:1,size:10},'refresh')
						}">刷新</button>
					</view>
					<scroll-view class="upload" scroll-y="true" @scrolltolower="scrolltoupper" :scroll-top="scrollTop"
						@scroll="scrollFile">
						<view v-for="(item,index) in fileList" :key="index" class="file_item">
							<view class="file_item_top">
								<text class="file_name">{{item.fileName}}</text>
								<image src="../../static/common/delete.png" class="file_del"
									v-if="authorList.includes('system_file_del')"
									@click.stop="()=>delFile(item,'upload')">
								</image>
							</view>
							<view>所属公司：<text>{{item.compName}}</text></view>
							<view>文件类型：<text>{{item.fileTypeName}}</text></view>
							<view>上传用户：<text>{{item.createPerson}}</text></view>
							<view class="upload_btn">
								<text class="btn" style="border-right: 1px solid #ccc;"
									@click="()=>handleDetailClick(item)"> 预览文件 </text>
								<text class="btn" @click="()=>toggle(item)"> 设置查看人员 </text>
							</view>
							<view class="downloadText" @click="()=>downloadFile(item)">预览不了文件？去下载</view>
						</view>
						<text v-if="fileList.length==0" class="noList">暂无文件</text>
						<uni-load-more v-if="fileList.length>9" :status="status" />
					</scroll-view>
				</view>
			</uni-forms>
			<button v-show='stepsKey==1' class="btn" @click="subMit" type="primary">
				{{type=='add'?'添 加':'修 改'}}</button>
			<!-- <view class="form_btn">
				<button v-show='stepsKey!=0' class="btn" @click="()=>changeKey('prev')"> 上一步 </button>
				<button v-show='stepsKey!=2' class="btn" @click="()=>changeKey('next')"> 下一步 </button>
			</view> -->
		</view>
		<uni-popup ref="popup" background-color="#fff">
			<view class="popup_btn">
				<button size="mini" style="color: deepskyblue;" @click="()=>setCheckedAll(true)">全选</button>
				<button size="mini" style="color: deepskyblue;" @click="subUser">提交</button>
				<button size="mini" style="color: deepskyblue;" @click="()=>setCheckedAll(false)">取消全选</button>
			</view>
			<view class="popup-content">
				<DaTreeVue2 ref="DaTreeRef" :data="userTree" labelField="title" valueField="id" defaultExpandAll
					:showCheckbox="true" :defaultCheckedKeys="defaultCheckedKeysValue" @change="handleTreeChange" />
			</view>
		</uni-popup>
	</view>
</template>

<script>
	import NavigationTitle from '@/components/navigationTitle'
	import DaTreeVue2 from '@/components/da-tree-vue2/index.vue'
	import {
		system_config
	} from '@/utils/_config.js'
	import {
		showToastMsg,
		showModalMsg,
		getSuffix,
		formatSize
	} from '@/utils/format.js'
	import {
		mapGetters,
		mapActions
	} from 'vuex'
	import cityTree from '@/static/city.json'
	export default {
		computed: {
			...mapGetters(['roleList', 'roleTree', 'cad_suffix', 'cons_suffix', 'project', 'projectId', 'authorList'])
		},
		components: {
			NavigationTitle,
			DaTreeVue2
		},

		data() {
			return {
				showList: false,
				isMore: false,
				status: 'more',
				scrollTop: 0,
				old: {
					scrollTop: 0
				},
				map: {
					text: 'roleName',
					value: 'roleId'
				},
				type: 'edit',
				stepsObj: [{
					title: '项目信息'
				}, {
					title: '公司列表'
				}, {
					title: '资料文件'
				}],
				roleOption: [],
				stepsKey: 0,
				alignment: 'top',
				baseFormData: {},
				rules: {
					projNumber: {
						rules: [{
							required: true,
							errorMessage: '项目编号不能为空！'
						}]
					},
					projName: {
						rules: [{
							required: true,
							errorMessage: '项目名字不能为空！'
						}]
					},
					projBeginTime: {
						rules: [{
							required: true,
							errorMessage: '项目开始时间不能为空！'
						}]
					},
					projEndTime: {
						rules: [{
							required: true,
							errorMessage: '项目结束时间不能为空！'
						}]
					},
				},
				dynamicLists: [],
				option: {
					url: system_config.apiBaseUrl + '/api/file/upload',
					method: 'put',
					name: 'file',
					header: {
						xtwAuthen: uni.getStorageSync("tokenValue") || '',
					},
					formData: {},
				},
				formats: "",
				files: new Map(),
				fileList: [],
				userTree: [],
				showPopup: false,
				defaultCheckedKeysValue: [],
				checkedKey: [],
				rootNodeKeys: [],
				selectFile: {},
				cityTree: {},
				seleData: [],
				seleValue: uni.getStorageSync('userInfo').compId,
				page: {
					current: 1,
					size: 10
				},
			}
		},
		onLoad(option) {
			// if (option?.type) this.type = option.type
			function recursion(data, str) {
				data.map(v => {
					if (str) v.value = str + ',' + v.name
					else v.value = v.name
					if (v.children && v.children.length != 0) recursion(v.children, v.value)
				})
			}
			recursion(cityTree, '')
			this.cityTree = cityTree

		},
		onShow(option) {
			// if (option?.type) this.type = option.type
			this.type = uni.getStorageSync('projectType') || ''
			this.roleOption = this.roleTree || []
			this.formats = this.cad_suffix + "," + this.cons_suffix
			this.baseFormData = this.project?.sysProject || {}
			this.dynamicLists = this.project?.companyUserRoleVOList || []
			console.log(this.dynamicLists)
			this.getFileList( {
					current: 1,
					size: 10
				})
			this.getCompList()
			this.getDevicesList()
			if (this.project.sysProject.totalMessage != 0) {
				uni.showTabBarRedDot({
					index: 2
				})
			} else {
				uni.hideTabBarRedDot({
					index: 2
				})
			}
			if (this.type == 'add') uni.hideTabBar({})
			else if (this.type == 'edit') uni.showTabBar({})
		},
		beforeDestroy() {
			let obj = {}
			if (this.type != 'add') return this.save_project(obj)
			obj = {
				sysProject: this.$refs.baseForm.modelValue,
				companyUserRoleVOList: this.dynamicLists
			}
			this.save_project({
				...obj
			})
			this.save_project_id('')

		},
		methods: {
			...mapActions(['save_project', 'save_project_id','save_devicesList']),
			async getDevicesList(){
				const res = await this.$api.getDevicesList({
					projectId: 4
					// projectId: this.projectId
				}).catch(err => {
					console.log(err)
				})
				console.log(res)
				if (res?.code == 200 && res.data.length != 0) {
					this.save_devicesList(res.data)
				}
			},
			scrollFile(e) {
				this.old.scrollTop = e.detail.scrollTop
			},
			goTop(e) {
				this.scrollTop = this.old.scrollTop
				this.$nextTick(function() {
					this.scrollTop = 0
				});
			},
			scrolltoupper() {
				this.getFileList(this.page, 'more')
			},
			onClickItem(e) {
				this.stepsKey = e.currentIndex
				console.log(e)
			},
			changeComp() {
				console.log(this.seleValue)
				this.page = {
					current: 1,
					size: 10
				}
				this.getFileList(this.page)
			},
			async getCompList() {
				const res = await this.$api.getComplist({
					projectId: this.projectId
				}).catch(err => {
					console.log(err)
				})
				if (res?.code == 200 && res.data.length != 0) {
					res.data.map(v => {
						v.text = v.compName
						v.value = v.compId
					})
					this.seleData = res.data
				}
			},
			async getFileUser() {
				await this.$api.getFileUser({
					fileId: this.selectFile.id
				}).then(res => {
					let arr = []
					if (res.code == 200 && res.data.length != 0) {
						res.data.map(v => {
							arr.push(v.compId + '-' + v.userId)
						})
					}
					this.defaultCheckedKeysValue = arr

				}).catch(err => {

				})
			},
			async toggle(data) {
				if(!this.authorList.includes('system_file_edit'))  return showToastMsg('没有编辑权限，需申请权限!')
				this.selectFile = data
				await this.getFileUser()
				await this.getUserTree()
				if (this.userTree.length == 0) this.userTree = []
				else {
					this.userTree.map(v => {
						this.rootNodeKeys.push(v.id)
						if (v.userDtos.length > 0) {
							v.userDtos.map(i => {
								v.children.push({
									id: v.id + '-' + i.userId,
									title: i.nickName
								})
							})
						}
					})
				}
				console.log(this.userTree, this.defaultCheckedKeysValue)
				this.$refs.popup.open('bottom')
			},
			handleTreeChange(allSelectedKeys, currentItem) {
				this.checkedKey = allSelectedKeys
			},
			async subUser() {
				if (!this.$refs.DaTreeRef?.getCheckedKeys()) return showToastMsg('请选择可见人员！')
				let arr = this.$refs.DaTreeRef?.getCheckedKeys()
				let keys = []
				arr.map(v => {
					let v_ = v.split('-')
					if (v_.length > 1) {
						keys.push(v_[1])
					}
				})
				const res = await this.$api.editFileUser({
					fileId: this.selectFile.id,
					userIds: keys
				}).catch(err => {
					console.log(err)
				})
				if (res?.code == 200) {
					this.$refs.popup.close()
					this.getUserTree()
				}
				showToastMsg(res.msg)
			},
			setCheckedAll(type) {
				this.$refs.DaTreeRef?.setExpandedKeys('all', true)
				this.$refs.DaTreeRef?.setCheckedKeys(this.rootNodeKeys, type)
			},
			async getUserTree() {
				const res = await this.$api.getUserTree({
					projectId: this.projectId
				}).catch(err => {
					console.log(err)
				})
				if (res?.code == 200) {
					this.userTree = res.data
				}
			},
			backSelf() {
				uni.redirectTo({
					url: '/pages/index/index'
				})
				// uni.navigateTo({
				// 	url:'/pages/index/index'
				// })
			},
			changeKey(type) {
				if (type == "prev") this.stepsKey = this.stepsKey == 0 ? this.stepsKey : this.stepsKey - 1
				else if (type == "next") this.stepsKey = this.stepsKey == this.stepsObj.length - 1 ? this.stepsKey : this
					.stepsKey + 1

			},
			changeRole(e) {
				console.log(e)
			},
			addFormItem() {
				if(this.type=='edit'&&!this.authorList.includes('system_project_edit')) return showToastMsg('无修改权限！')
				this.dynamicLists.unshift({
					roleId: null,
					companyName: '',
					userName: "",
					userPhone: '',
					id: Date.now()
				})
				console.log(this.dynamicLists)
			},
			delFormItem(id) {
				if(this.type=='edit'&&!this.authorList.includes('system_project_edit')) return showToastMsg('无修改权限！')
				let index = this.dynamicLists.findIndex(v => v.id === id)
				this.dynamicLists.splice(index, 1)
			},
			subMit() {
				if(this.type=='edit'&&!this.authorList.includes('system_project_edit')) return showToastMsg('无修改权限！')
				this.$refs.baseForm.validate().then(res => {
					let target = true
					if (this.dynamicLists.length > 0) {
						this.dynamicLists.map(v => {
							for (let key in v) {
								if (!v[key]) {
									target = false
									showToastMsg('请输入项目成员！')
								}
							}
						})
					} else {
						target = false
						showToastMsg('请输入项目成员！')
					}
					if (target) {
						if (this.type == 'add') this.addProj(res)
						else if (this.type == 'edit') this.updetaProj(res)
					}
				}).catch(err => {
					console.log(err)
				})
			},
			async addProj(obj) {
				let param = {
					sysProject: obj,
					companyUserRoleVOList: this.dynamicLists
				}
				const res = await this.$api.createProj(param).catch(err => {
					showToastMsg('请求异常，请重试！')
				})
				if (res.code == 200) {
					this.type = 'edit'
					this.save_project_id(res.data.projectId)
					showToastMsg(res.msg)
					this.changeKey('next')

				} else showToastMsg(res.msg)
			},
			async updetaProj(obj) {
				if (!this.projectId) return
				let param = {
					sysProject: obj,
					companyUserRoleVOList: this.dynamicLists
				}
				param.sysProject.projId = this.projectId
				const res = await this.$api.updateProj(param).catch(err => {
					showToastMsg('请求异常，请重试！')
				})
				if (res.code == 200) {
					showToastMsg(res.msg)
					this.changeKey('next')
				} else showToastMsg(res.msg)
			},
			changeFile(files) {
				this.files = [...files.values()]

			},
			delFile(data, type) {
				let that = this
				if (type == 'noUpload') {
					this.$refs.lsjUpload.clear(data.name)
				} else {
					showModalMsg('', '是否确认删除这个文件', async (val) => {
						if (val) {
							await that.$api.delFile({
								ids: data.id
							}).then(res => {
								if (res?.code == 200) {
									this.page = {
										current: 1,
										size: 10
									}
									this.getFileList(this.page)
								}
								showToastMsg(res.msg)
							}).catch(err => {
								showToastMsg("请求失败！")
							})
						}

					})
				}

			},
			delAll() {
				this.$refs.lsjUpload.clear()
			},
			async getFileList(page, type) {
				if (!this.projectId || !this.seleValue) return showToastMsg('请先选择公司')
				if (this.status == 'loading') return
				let {
					current,
					size
				} = page
				if (type == 'more' && this.isMore) current += 1
				else if (type == 'more' && !this.isMore) return
				if (type == 'refresh') {
					this.goTop()
					this.status = 'more'
					this.page = {
						current,
						size
					}
					console.log(this.scrollTop)
				}
				this.status = 'loading'
				let param = {
					belongProject: this.projectId,
					compId: this.seleValue,
					current,
					size
				}
				const res = await this.$api.getFileList(param).catch(err => {
					showToastMsg('请求异常！')
				})
				if (res?.code == 200) {
					if (res.data.records.length < 10) {
						this.isMore = false
						this.status = 'noMore'
					} else {
						this.isMore = true
						this.status = 'more'
					}
					this.page = {
						current,
						size
					}
					if (type == 'more') {
						this.fileList = this.fileList.concat(res.data.records)
						this.page = {
							current,
							size
						}
					} else {
						this.fileList = res.data.records
					}

				}
			},
			subFile() {
				if (!this.projectId) return showToastMsg('请先提交项目基本信息！')
				if (this.files.length == 0) return
				this.$refs.lsjUpload.upload()
			},
			changeDrawer(e) {
				if (!e) this.delAll()
			},
			onprogre(data) {
				// this.files.set(data.name,data);
				this.$forceUpdate();
			},
			onuploadEnd(data) {
				// this.files.set(data.name,data);
				this.$forceUpdate();
				if (data.type == "success") {
					let res = JSON.parse(data.responseText)
					if (res.code == 200) this.addFile(data)
					else showToastMsg(res.msg)
				}
			},
			openList() {
				if (this.authorList.includes('system_file_add')) this.$refs.showList.open()
				else showToastMsg('无上传文件权限！')
			},
			closeList() {
				this.$refs.showList.close()
			},
			async addFile(data) {
				let arr = this.cad_suffix.split(',')
				let suffix = getSuffix(data.name)
				let obj = {
					belongProject: this.projectId,
					fileName: data.name,
					fileType: arr.includes(suffix) ? "1" : "2",
					fileUrl: JSON.parse(data.responseText).msg,
				}
				await this.$api.addFile(obj).then(res => {
					if (res.code == 200) {
						this.closeList()

					}
					showToastMsg(res.msg)
				}).catch(err => {
					console.log(err)
					showToastMsg('请求异常！')
				})
			},
			async handleDetailClick(data) {
				if (data.viewed==0) return showToastMsg('没有查看权限，请申请查看权限!')
				if (data.viewed==2) return showToastMsg('权限审批中，请稍等!')
				const res = await this.$api.fileTopdf({
					fileUrl: data.fileUrl
				}).catch(err => {
					console.log(err)
					showToastMsg('请求异常！')
				})
				if (res?.code == 200) {
					// #ifdef H5
					showToastMsg('请在App内打开文件！')
					// #endif
					// #ifdef APP-PLUS
					uni.navigateTo({
						url: `/pages/webView/index?path=${res.msg}&title=${data.fileName}`
					})
					// #endif

				} else showToastMsg('文件打开失败！')

			},
			async downloadFile(data){
				if (data.viewed==1) {
					uni.showLoading({
						title: "下载中...",
						mask: true
					})
					uni.downloadFile({
						url: data.fileUrl, //仅为示例，并非真实的资源
						success: (res) => {
							if (res.statusCode === 200) {
								showToastMsg('下载成功')
							}
						},
						fail:()=>{
							showToastMsg('下载失败')
						},
						complete:()=>{
							uni.hideLoading()
						},
					});
				}
				else return showToastMsg('没有下载权限，需申请权限!')
			},
			maskClick(e) {
				console.log('maskClick事件:', e);
			},
			getSize(size) {
				return formatSize(size)
			},
		}
	}
</script>

<style lang="scss" scoped>
	@import '@/assets/styles/global.scss';

	view {
		box-sizing: border-box;
	}

	.user_page {
		position: relative;
		height: 100vh;

		/deep/ .uni-popup__wrapper {
			padding: 24rpx;
		}
	}

	.form {
		padding: $System__title_height 24rpx 20rpx;

		.uni-steps {
			margin: 28rpx 0 16rpx;
		}

		.form_main {
			height: 100%;
		}

		.form-tab_long {
			height: calc(100vh - 300rpx) !important;
		}

		.form-tab {
			width: 100%;
			height: calc(100vh - 400rpx);
			min-height: 800rpx;
			overflow: auto;
			position: relative;

			/deep/ .uni-drawer__content {
				padding: 12rpx 12rpx 24rpx;
			}

			.tab_select {
				display: flex;
				align-items: center;
				justify-content: center;
				margin-bottom: 15rpx;

			}

			.open_list {
				width: 130rpx;
				height: 130rpx;
				border-radius: 50%;
				position: fixed;
				bottom: 220rpx;
				right: 60rpx;
				display: flex;
				align-items: center;
				justify-content: center;
				opacity: 0.9;
				z-index: 1;
			}

			.notUpload {
				height: 1000rpx;
				overflow: auto;
				margin-bottom: 24rpx;

				.file_item {
					margin-bottom: 24rpx;
					// border: 1px solid #999;
					box-shadow: 0rpx 5rpx 10rpx 0rpx #F0F0F0;
					padding: 12rpx 24rpx;

					&_top {
						display: flex;
						justify-content: space-between;
						align-items: center;
					}

					.file_name {
						width: 90%;
						overflow: hidden;
						text-overflow: ellipsis;
						white-space: nowrap;
						font-size: 32rpx
					}

					.file_del {
						width: 35rpx;
						height: 45rpx;
					}

				}
			}

			.upload {
				height: calc(100vh - 450rpx);
				overflow: auto;

				.noList {
					position: absolute;
					top: 50%;
					left: 50%;
					transform: translate(-50%, -50%);
					font-size: 36rpx;
					color: #999;
				}

				.file_item {
					margin-bottom: 24rpx;
					// border: 1px solid #999;
					box-shadow: 0rpx 5rpx 10rpx 0rpx #F0F0F0;
					padding: 12rpx 24rpx;

					&_top {
						display: flex;
						justify-content: space-between;
						align-items: center;
					}

					.file_name {
						width: 90%;
						overflow: hidden;
						text-overflow: ellipsis;
						white-space: nowrap;
						font-size: 32rpx
					}

					.file_del {
						width: 35rpx;
						height: 45rpx;
					}

					.upload_btn {
						margin-top: 12rpx;
						display: flex;
						justify-content: space-between;
						align-items: center;
						border-top: 1px solid #fff;
						background-color: #fff;

						.btn {
							width: 49%;
							padding: 12rpx 0;
							text-align: center;
							background-color: #fff;
							color: rgb(97, 86, 255);
						}
					}
					.downloadText{
						width: 100%;
						text-align: center;
						color: blue;
						opacity: 0.5;
						font-size: 24rpx;
						text-decoration: underline;
						margin-top: 15rpx;
					}
				}
			}

			.upload_title {
				width: 100%;
				font-size: 36rpx;
				display: flex;
				justify-content: space-between;
			}

			.no_upload_btn {
				display: flex;
				justify-content: space-around;
			}
			.addBtn{
				background-color: #fff;
				color: #000;
				border: 1px dashed #999;
				&::after{
					border: 0;
				}
			}
			.form-item {
				border-bottom: 1px solid #999;

				&>uni-view {
					margin-bottom: 24rpx;
				}

				.form-item-button {
					color: red;
				}
			}
		}

		.uni-forms-item {
			/deep/ .uni-forms-item__label {
				width: 100% !important;
				font-size: 34rpx;
			}

			/deep/ .uni-forms-item__content {
				flex: 1;
				min-height: 70rpx;
				padding: 0 12rpx;
			}

			/deep/ .uni-input-placeholder {
				font-size: 28rpx;
			}

			/deep/ .uni-select__input-placeholder {
				font-size: 28rpx;
				color: #999;
			}
			/deep/ .is-disabled {
				background-color: #fff !important;
				color: #333;
			}
			
			/deep/ .uni-date-editor--x__disabled {
				opacity: 1;
			}
		}

		.form_btn {
			display: flex;
			align-items: center;
			justify-content: space-between;
			margin-top: 12rpx;
			width: 100%;

			.btn {
				padding: 0 24rpx;
				width: 25%;
				overflow: hidden;
			}
		}
	}

	.popup_btn {
		display: flex;
		justify-content: space-around;
		align-items: center;
		width: 100%;
	}

	.popup-content {
		max-height: 1000rpx;
		min-height: 500rpx;
		overflow: auto;
	}

	.back_icon {
		width: 37upx;
	}
</style>